using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using WebTool;
using WebToolService;

namespace WebTool
{
    public class HomeController : BaseController
    {
        public ActionResult Index()
        {
            if (IsLogin())
            {
                return View();
            }
            else
            {
                return RedirectToLoginPage();
            }
            return View();
        }

        private bool IsLogin()
        {
            bool res = (Request.Cookies[ConstParameter.WebToolUserName] == null) ? false : true;

            return res;
        }
        public ActionResult RedirectToLoginPage()
        {
            return RedirectToAction("Login", "Account");
        }

    }
}